package server;

import iface.HvZUser;
import iface.Registration;
import iface.Status;

/**
 * Interface of how to interact with the database.
 */
public interface ClientQueryable {

    /**
     * @return Status object with a list of humans
     */
    public Status getHumansList();

    /**
     * @return Status object with a list of zombies
     */
    public Status getZombiesList();

    /**
     * @return Status object with a list of observers
     */
    public Status getObserversList();

    /**
     * Registers a new user
     * 
     * @param user
     *            the user to register
     * @return A Status indication success or failure
     */
    public Status registerNewUser(Registration user);

    /**
     * Change a user to a zombie
     * 
     * @param username
     *            the user to change
     * @return A Status indication success or failure
     */
    public Status changeToZombie(String username);

    /**
     * Change which database to connect to
     * 
     * @param db
     *            the database to connect to
     */
    public void setDatabase(String db);

    /**
     * @return a String that is the name of the current database
     */
    public String getDatabase();

    /**
     * Checks if the user exists in the database
     * 
     * @param username
     *            the user to search for
     * @return true if the user is in the database, false otherwise
     */
    public boolean doesUserExist(String username);

    /**
     * Searches the Database for the user
     * 
     * @param username
     *            The user to return
     * @return returns a HvZUser if the user is found, null otherwise
     */
    public HvZUser getUser(String username);

}
